package com.kingcore.commerce.base.dao;

import java.text.SimpleDateFormat;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;

import com.kingcore.framework.base.dao.impl.DaoJdbcPlainImpl;

/**
 * <br> 
 * <strong>Create on : 2011-12-31<br></strong>
 * <p>
 * <strong>Copyright (C) KingCore Software Co.,Ltd.<br></strong>
 * <p>
 * @author wuzeven@163.com<br>
 * @version <strong>e-Commerce v1.0.0</strong><br>
 * @param <T>
 */
public abstract class CommerceDaoImpl<T, PK extends java.io.Serializable> 
				extends DaoJdbcPlainImpl implements CommerceDao<T, PK> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	protected static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	protected static Logger log = Logger.getLogger(CommerceDaoImpl.class);


	protected static boolean isNotBlank(Object obj) {
		if(obj==null){
			return false;
		}
		return StringUtils.isNotBlank(obj.toString());
	}

	/**
	 * wzw:与hibernate的接口保持一致
	 * @param clazz
	 * @param sql_count
	 * @param sql_datas
	 * @param pageNo
	 * @param pageSize
	 * @param params
	 * @return
	 * @throws Exception
	 */
//	public Pagination queryForPagedList(Class<?> clazz,
//			String sql_count, String sql_datas, int pageNo, int pageSize,
//			Object[] params) throws Exception {
//		
//		WebPageNavigator webPageNavigator = new WebPageNavigator(pageNo, pageSize, -1);
//		List<?> list = super.queryForPagedList(new WebPageNavigator(pageNo, pageSize, -1), clazz, sql_count, sql_datas, params);
//		return new Pagination(webPageNavigator.getPageNumber(), webPageNavigator.getPageSize(),
//				                    webPageNavigator.getRowCount(), list);
//	}
	
}
